using NL;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using NL.UI;
namespace XGame.UI
{
    public class UISkillItem : MonoBehaviour
    {
        public Transform panel_type1;
    	public Transform panel_type2;

        public Button _Button;

        public void Awake()
        {
            _Button = GetComponentInChildren<Button>();

            if (_Button != null) _Button.onClick.AddListener(() =>
               {
                   _ONClick?.Invoke(gameObject.INFOOf("id"));
               });
        }

        public void Show()
        {
            bool sign = gameObject.INFOOf("type") == 1;
            panel_type1.gameObject.SetActive(!sign);
            panel_type2.gameObject.SetActive(sign);
        }

        IniAction<int> _ONClick;
        public UISkillItem WaitClick(IniAction<int> _on)
        {
            _ONClick = _on;
            return this;
        }

    }
}